@extends('app')
@section('content')
    <div class="jumbotron">
        <div class="container">
        <h2>1欢迎来到绍兴张学友的社区
            <a class="btn btn-lg btn-danger pull-right" href="/discussions/create" role="button">发布新帖 &raquo;</a>
        </h2>
        </div>
    </div>
<div class="container">
    <div class="row">
        <div class="col-md-9" role="main">
            @foreach($discussions as $discussion)
                <div class="media">
                    <div class="media-left">
                        <a href="#">
                            <img class="media-object img-circle avatar" style="width: 64px;height: 64px;" alt="64x64" src="{{ $discussion->user->avatar }}">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading">
                        <a href="/discussions/{{ $discussion->id }}" >{{ $discussion->title }}</a>
                            <div class="media-conversation-meta">
                                <span class="media-conversation-replies">
                                    <a href="/discussions/{{ $discussion->id }}#commits">{{ count($discussion->comments) }}</a>回复
                                </span>
                            </div>
                        </h4>
                        {{ $discussion->user->name }} 在 {{ $discussion->created_at }} 发布
                    </div>
                </div>
            @endforeach
            <div style="margin:auto;text-align:center">
            @include('page.page',['results'=>$discussions])
            </div>
        </div>
    </div>
</div>
@stop